﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Net;
using Contract;
namespace Service
{
    class Program
    {
        static void Main(string[] args)
        {
            // create a hosting process for CalculatorService
            ServiceHost host = new ServiceHost(typeof(DataUploader));

            NetTcpBinding binding = new NetTcpBinding();
            binding.TransferMode = TransferMode.Streamed;
            binding.ReceiveTimeout = TimeSpan.MaxValue;
            binding.MaxReceivedMessageSize = int.MaxValue;

            host.AddServiceEndpoint(typeof(IDataUploader), binding,
            new Uri("net.tcp://127.0.0.1:5000/DataUploader"));
            
            host.Open();

            Console.WriteLine("The service is being hosted");
            Console.WriteLine("Press <ENTER> to stop hosting.\n");
            Console.ReadLine();
            
            host.Close();



        }
    }
}
